AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua") 
include('shared.lua')     

function ENT:SpawnFunction( ply, tr )
	if ( !tr.Hit ) then return end
	local SpawnPos = tr.HitPos + tr.HitNormal * 16
	local ent = ents.Create( "pilotable_scanner_setup" )
	ent:SetPos( SpawnPos )
	ent:Spawn()
	ent:Activate()
	return ent
end

function ENT:Initialize()     	
	self.Entity:SetModel("models/combine_scanner.mdl")  	
	self.Entity:PhysicsInit(SOLID_VPHYSICS) 	
	self.Entity:SetMoveType(MOVETYPE_VPHYSICS) 	
	self.Entity:SetSolid(SOLID_VPHYSICS)
	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end
end

function ENT:AcceptInput(name,activator,caller)
	if name == "Use" and caller:IsPlayer() then
		DataFunctions.Start(caller, 1)
		self.Entity:Remove()
	end
end